package com.loadmore.oneday.adapter

import android.content.Context
import android.widget.ImageView
import android.widget.TextView
import com.loadmore.common.base.BaseAdapter
import com.loadmore.common.base.RVBaseHolder
import com.loadmore.common.router.Router
import com.loadmore.oneday.R
import com.loadmore.oneday.model.MenuItem

/**
 *@author sunleilei
 *@date 2018/7/17
 *@time 15:42
 *
 */
class MineSettingAdapter(context: Context?) : BaseAdapter(context) {

    override fun getLayoutId(): Int {
        return R.layout.layout_item_mine_setting
    }

    override fun onBindViewHolder(holder: RVBaseHolder<*>, position: Int) {
        val menuItem = getItem(position) as MenuItem
        var icon:ImageView = holder.retrieve(R.id.icon) as ImageView
        icon.setImageResource(R.mipmap.icon_mine)
        var title:TextView = holder.retrieve(R.id.title) as TextView
        title.text = menuItem.title
        holder.itemView.setOnClickListener {
            Router.go(menuItem.module,null)
        }
    }



}